<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <title>打印商铺码</title>
  <link rel="stylesheet" href="../../style/component/elementUI/index.css" />
  <script type="text/javascript" src="../../config/config.js"></script>
  <script type="text/javascript" src="../../utils/compressor.js"></script>
  <script type="text/javascript" src="../../utils/ID_Validity.js"></script>
  <script type="text/javascript" src="../../utils/utils.js"></script>
  <script type="text/javascript" src="../../utils/jquery.min.js"></script>
  <script type="text/javascript" src="../../utils/jquery.qrcode.min.js"></script>
  <script type="text/javascript" src="../../utils/vue.min.js"></script>
  <script type="text/javascript" src="../../utils/jweixin.js"></script>
  <script type="text/javascript" src="../../utils/vuex.min.js"></script>
  <script type="text/javascript" src="component/elementUI/index.js"></script>
</head>

<body>
  <div id="app">
    <div id="qrcode-container" style="width: 160px; height: 160px;"></div>
    <!-- <el-button @click="downloadQRCode()" type="priqrcode-containerry" size="sqrcode-containerll">下载</el-button>
    <el-button @click="printQRCode()" type="danger" size="sqrcode-containerll">打印</el-button> -->
  </div>
  <script>
    const app = new Vue({
      el: "#app",
      data(){
        return {

        }
      },
      mounted() {
        this.drawQRCode();
      },
      methods: {
        drawQRCode() {
          const that = this;
          $.ajax({
            url: `${BASE_URL1}/WechatUrlLink2`,
            type: 'POST',
            data: {
              Query: JSON.stringify({way:'1'}),
              Path: '/pages/index/goods'
            },
            success: function (res) {
              if (res.Status == 'success') {
                $("#qrcode-container").qrcode({
                  width: 160, // 二维码宽度（单位像素）
                  height: 160, // 二维码高度（单位像素）
                  text: res.Url, // 二维码包含的内容
                });
              }
            },
            error: function () {
              that.$message.error("操作失败，请稍后再试")
            },
            complete: function (XMLHttpRequest) {
              that.loading = false;
              requestPretreatment(XMLHttpRequest);
            },
            dataType: "json"
          })
        },
      },
    });
  </script>
</body>

</html>